import request from './request';

// 获取端口转发列表
export function getPortLocalForwardList() {
    return request({
        url: '/port-local-forward',
        method: 'get',
    });
}
// 新增端口转发
export function addPortLocalForward(data) {
    return request({
        url: '/port-local-forward',
        method: 'post',
        data,
    });
}
// 编辑端口转发
export function editPortLocalForward(data) {
    return request({
        url: `/port-local-forward/${data.id}`,
        method: 'put',
        data,
    });
}
// 编辑端口转发基础信息
export function editPortLocalForwardBaseMessage(data) {
    return request({
        url: `/port-local-forward/${data.id}/base-message`,
        method: 'put',
        data,
    });
}
// 删除端口转发
export function deletePortLocalForward(id) {
    return request({
        url: `/port-local-forward/${id}`,
        method: 'delete',
    });
}
// 启动端口转发
export function startPortLocalForward(portLocalForwardIds) {
    return request({
        url: `/port-local-forward/batch/start`,
        method: 'post',
        data: { portLocalForwardIds },
    });
}
// 停止端口转发
export function stopPortLocalForward(portLocalForwardIds) {
    return request({
        url: `/port-local-forward/batch/stop`,
        method: 'post',
        data: { portLocalForwardIds },
    });
}
// 切换SSH隧道
export function switchSshTunnel(portLocalForwardIds, sshTunnelId) {
    return request({
        url: `/port-local-forward/batch/switch-ssh-tunnel`,
        method: 'post',
        data: { portLocalForwardIds, sshTunnelId },
    });
}